package javaClassExercise.stringTest;

/**
 * Java： String、StringBuffer、StringBuilder
 * Created by lomo on 2017.
 */
public class stringTestone {

    public static void main(String[] args) {

        String a = "Lomo";
        String b = new String("Lomo");

        String c = "Lomo";

        System.out.println(a == b);

        System.out.println(a.equals(b));

        System.out.println(a == c);
        System.out.println(a.equals(c));

        System.out.println("--------------------------");

        StringBuffer sb = new StringBuffer("Lomoa");
        StringBuffer sb2 = new StringBuffer("Lomoa");
        System.out.println(sb == sb2);
        System.out.println(sb.equals(sb2));

        System.out.println("--------------------------");

        StringBuilder sbb = new StringBuilder("Looo");
        StringBuilder sbb2 = new StringBuilder("Looo");
        System.out.println(sbb == sbb2);
        System.out.println(sbb.equals(sbb2));
    }
}
